﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using System.IO;
using Microsoft.Xna.Framework.Content;

namespace Neeko.XNA.UI
{
    public class UIResourceRepository
    {
        public static SpriteFont UIFont { get; set; }
        static Dictionary<Type, Texture2D> _textures;

        public static void Initialize(GraphicsDevice graphicsDevice, ContentManager content)
        {
            UIFont = content.Load<SpriteFont>(@"XNA_Neeko_UI_Resources\Fonts\UI_Font");

            _textures = new Dictionary<Type, Texture2D>();

            FileInfo fi = new FileInfo(@"Content\XNA_Neeko_UI_Resources\Textures\Button.png");
            Texture2D texture = Texture2D.FromStream(graphicsDevice, fi.OpenRead());
            _textures.Add(typeof(Button), texture);         
        }

        public static Texture2D Resolve(Type type)
        {
            return _textures[type];
        }
    }
}
